import { ref, watch } from "vue";

export default function(title = "默认标题") {
  let titleRef = ref(title);

  watch(
    titleRef,
    (newValue) => {
      document.title = newValue;
    },
    {
      immediate: true,
    }
  );
  return titleRef;
}
